package com.lws.omapicompat.google

import android.os.Build
import android.se.omapi.Reader
import androidx.annotation.RequiresApi
import com.lws.omapicompat.ReaderCompat
import com.lws.omapicompat.SEServiceCompat
import com.lws.omapicompat.SessionCompat

@RequiresApi(Build.VERSION_CODES.P)
class ReaderNew(private val seServiceNew: SEServiceNew, private val reader: Reader) :
    ReaderCompat {

    override fun closeSessions() {
        reader.closeSessions()
    }

    override fun getName(): String {
        return reader.name
    }

    override fun getSEService(): SEServiceCompat {
        return seServiceNew
    }


    override fun isSecureElementPresent(): Boolean {
        return reader.isSecureElementPresent
    }

    override fun openSession(): SessionCompat {
        val session = reader.openSession()
        return SessionNew(this, session)
    }
}